package com.bidu.common;

import org.springframework.context.ApplicationContext;

/**
 * Created by tang.tang on 2017/1/22.
 * 上下文获取工具类
 */
public class SpringContextUtil {

    private static ApplicationContext applicationContext;

    public static void setApplicationContext(ApplicationContext context) {
        applicationContext = context;
    }

    public static Object getBean(String beanId) {
        return applicationContext.getBean(beanId);
    }

    public static ApplicationContext getApplicationContext() {
        return applicationContext;
    }
}
